<?php
class Admin_IndexController extends Zend_Controller_Action
{
	protected $_arrParam;
	public function init()
	{
		$this->_arrParam = $this->_request->getParams();
		$this->view->arrParam = $this->_arrParam;
		/* $this->_helper->getHelper('layout')->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true); */
		/* $contextSwitch = $this->_helper->getHelper('contextSwitch');
		$contextSwitch->addActionContext('getchart','json')
					  ->initContext(); */
	}
	
	/**
	 * The default action - show the home page
	 */
	public function indexAction() {
		
	}

	public function thongkeAction()
	{
		$this->_helper->viewRenderer->setNoRender();
		$this->_helper->getHelper('layout')->disableLayout();
		
		$hocvienMapper = Data_Model_HocVienMapper::getInstance();
		$thongke[0] = array('Tháng', 'Số Lượng Học Viên');
		for($i=1;$i<=12;$i++)
		{
		$hocvienlistdate = $hocvienMapper->HocvienListDate($i,2013);
		$sohocvien = count($hocvienlistdate);
		$thongke[] = array($i,$sohocvien);
		}
		header('Conten-type: application/json');
		echo Zend_Json::encode($thongke);
	}
	
}